using DataAccess.Entities;
using FluentNHibernate.Mapping;

namespace DataAccess.Mappings
{
    public sealed class ProfileMap : ClassMap<Profile>
    {
        public ProfileMap()
        {
            Id(x => x.Id);
            Map(x => x.Complete);
            References(x => x.Account);
            References(x => x.Passion);
            Map(x => x.Picture);
            Map(x => x.Url);
            Map(x => x.Bio);
            Map(x => x.Birthday);
            Map(x => x.Status);
            References(x => x.Gender);
            References(x => x.RelationshipStatus);
            HasMany(x => x.Interests).Cascade.All().Inverse();
            References(x => x.InterestedIn);
//            HasMany(x => x.FavEntertainment).Cascade.All().Inverse();
//            HasMany(x => x.FavFood).Cascade.All().Inverse();
            HasMany(x => x.Media).Cascade.All().Inverse();
            HasMany(x => x.Discussions).Cascade.All().Inverse();
            HasMany(x => x.Comments).Cascade.All().Inverse();
            HasMany(x => x.Events).Cascade.All().Inverse();
        }
    }
}